﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using System.Web.Configuration;
using Domain;

namespace HotelBrisaYArenaAdministrador
{
    public partial class ManejaReservaciones : System.Web.UI.Page
    {
        ReservacionBusiness resBusbiness = new ReservacionBusiness(WebConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
        LinkedList<Reservacion> reservaciones = new LinkedList<Reservacion>();
        Reservacion reservacion = new Reservacion();

        protected void Page_Load(object sender, EventArgs e)
        {
            int idReservacion = Int32.Parse(Request.QueryString["id"].ToString());
            reservacion = resBusbiness.RecuperaReservacionXID(idReservacion);
            lblIDReservacion.Text = reservacion.IdReservacion.ToString();
            lblNombre.Text = reservacion.NombreCliente;
            lblApellidos.Text = reservacion.ApellidosCliente;
            lblEmail.Text = reservacion.Email;

            DetalleReservacion detalle = resBusbiness.RecuperaDetalleReservacionXID(idReservacion);
            reservacion.DetalleReservacion = detalle;

            LinkedList<Reservacion> reservaciones = new LinkedList<Reservacion>();
            reservaciones.AddLast(reservacion);
            Repetidor1.DataSource = reservaciones;
            Repetidor1.DataBind();
        }
    }
}